<?php
class TdTextField extends TdFormField {

  public $size;
  public $maxlength;
  
  function __construct($id, $template="") {
    parent::__construct($id, $template);
  }

  function __toString() {
  	$pout = parent::__toString();
  	if ($pout != "") {
    	return $pout;
  	}
  	 
    ob_start();

    if (isset($this->label)) {
      print($this->label);
    }
    print("<input id=\"".$this->id."\" name=\"".$this->name."\" type=\"text\"");
    if (isset($this->size)) print(" size=\"".$this->size."\"");
    if (isset($this->maxlength)) print(" maxlength=\"".$this->maxlength."\"");
    if (isset($this->cssclass)) print(" class=\"".$this->cssclass."\"");
    print(" value=\"".$this->value."\"\/>");
    
    return ob_get_clean(); 
  }

  function setSize($value) {
    $this->size = $value;
  }
  
  function getSize() {
    return $this->size;
  }   

  function setMaxLength($value) {
    $this->maxlength = $value;
  }
  
  function getMaxLength() {
    return $this->maxlength;
  }  

}
?>